home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / DCLAP 4j / vibrant / vibtypes.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-17  |  10.9 KB  |  313 lines  |  [TEXT/R*ch]

  1. /*   vibtypes.h
  2. * ===========================================================================
  3. *
  4. *                            PUBLIC DOMAIN NOTICE
  5. *            National Center for Biotechnology Information (NCBI)
  6. *
  7. *  This software/database is a "United States Government Work" under the
  8. *  terms of the United States Copyright Act.  It was written as part of
  9. *  the author's official duties as a United States Government employee and
  10. *  thus cannot be copyrighted.  This software/database is freely available
  11. *  to the public for use. The National Library of Medicine and the U.S.
  12. *  Government do not place any restriction on its use or reproduction.
  13. *  We would, however, appreciate having the NCBI and the author cited in
  14. *  any work or product based on this material
  15. *
  16. *  Although all reasonable efforts have been taken to ensure the accuracy
  17. *  and reliability of the software and data, the NLM and the U.S.
  18. *  Government do not and cannot warrant the performance or results that
  19. *  may be obtained by using this software or data. The NLM and the U.S.
  20. *  Government disclaim all warranties, express or implied, including
  21. *  warranties of performance, merchantability or fitness for any particular
  22. *  purpose.
  23. *
  24. * ===========================================================================
  25. *
  26. * File Name:  vibtypes.h
  27. *
  28. * Author:  Jonathan Kans
  29. *
  30. * Version Creation Date:   7/1/91
  31. *
  32. * $Revision: 2.11 $
  33. *
  34. * File Description: 
  35. *       Vibrant object and data type definitions
  36. *
  37. * Modifications:  
  38. * --------------------------------------------------------------------------
  39. * Date     Name        Description of modification
  40. * -------  ----------  -----------------------------------------------------
  41. *
  42. *
  43. * ==========================================================================
  44. */
  45.  
  46. #ifndef _VIBTYPES_
  47. #define _VIBTYPES_
  48.  
  49. /***  PLATFORM DEFINITION, STANDARD DATA TYPES AND MACROS  ***/
  50.  
  51. /*
  52. *  The NCBI defines standard headers for local definition of
  53. *  portable data types and macros.  The ncbi.h header includes
  54. *  ncbilcl.h, which specifies data types for a given platform.
  55. */
  56.  
  57. #ifndef _NCBI_
  58. #include <ncbi.h>
  59. #endif
  60. #ifndef _NCBIDRAW_
  61. #include <ncbidraw.h>
  62. #endif
  63.  
  64. #ifdef __cplusplus
  65. extern "C" {
  66. #endif
  67.  
  68. /***  INTERFACE PARENT BASE TYPE  ***/
  69.  
  70. typedef  struct  Nlm_graphic {
  71.   Nlm_VoidPtr  dummy;
  72. } HNDL Nlm_GraphiC;
  73.  
  74. /***  INTERFACE OBJECT TYPES  ***/
  75.  
  76. /*
  77. *  Interface variables will be used by programmers to refer
  78. *  to specific objects on the display screen. General
  79. *  purpose procedures will use these variables to locate
  80. *  the data structures necessary to manipulate the objects.
  81. *  The typical programmer will be able to rely on these
  82. *  high-level procedures to manage the user interface, and
  83. *  will not need access to the internal data structures.
  84. *
  85. *  By defining object types as handles to specific dummy
  86. *  structures, compilers can detect attempts to incorrectly
  87. *  use some interface functions (such as trying to insert a
  88. *  button into a menu, instead of a group or window).
  89. */
  90.  
  91. typedef  struct  Nlm_bar {
  92.   Nlm_VoidPtr  dummy;
  93. } HNDL Nlm_BaR;
  94.  
  95. typedef  struct  Nlm_button {
  96.   Nlm_VoidPtr  dummy;
  97. } HNDL Nlm_ButtoN;
  98.  
  99. typedef  struct  Nlm_choice {
  100.   Nlm_VoidPtr  dummy;
  101. } HNDL Nlm_ChoicE;
  102.  
  103. typedef  struct  Nlm_display {
  104.   Nlm_VoidPtr  dummy;
  105. } HNDL Nlm_DisplaY;
  106.  
  107. typedef  struct  Nlm_icon {
  108.   Nlm_VoidPtr  dummy;
  109. } HNDL Nlm_IcoN;
  110.  
  111. typedef  struct  Nlm_item {
  112.   Nlm_VoidPtr  dummy;
  113. } HNDL Nlm_IteM;
  114.  
  115. typedef  struct  Nlm_list {
  116.   Nlm_VoidPtr  dummy;
  117. } HNDL Nlm_LisT;
  118.  
  119. typedef  struct  Nlm_menu {
  120.   Nlm_VoidPtr  dummy;
  121. } HNDL Nlm_MenU;
  122.  
  123. typedef  struct  Nlm_panel {
  124.   Nlm_VoidPtr  dummy;
  125. } HNDL Nlm_PaneL;
  126.  
  127. typedef  struct  Nlm_popup {
  128.   Nlm_VoidPtr  dummy;
  129. } HNDL Nlm_PopuP;
  130.  
  131. typedef  struct  Nlm_prompt {
  132.   Nlm_VoidPtr  dummy;
  133. } HNDL Nlm_PrompT;
  134.  
  135. typedef  struct  Nlm_repeat {
  136.   Nlm_VoidPtr  dummy;
  137. } HNDL Nlm_RepeaT;
  138.  
  139. typedef  struct  Nlm_slate {
  140.   Nlm_VoidPtr  dummy;
  141. } HNDL Nlm_SlatE;
  142.  
  143. typedef  struct  Nlm_switch {
  144.   Nlm_VoidPtr  dummy;
  145. } HNDL Nlm_SwitcH;
  146.  
  147. typedef  struct  Nlm_text {
  148.   Nlm_VoidPtr  dummy;
  149. } HNDL Nlm_TexT;
  150.  
  151. typedef  struct  Nlm_window {
  152.   Nlm_VoidPtr  dummy;
  153. } HNDL Nlm_GrouP, HNDL Nlm_WindoW;
  154.  
  155. /***  ENUMERATED MESSAGE AND INTERFACE CALLBACK PROCEDURE TYPES  ***/
  156.  
  157. /*
  158. *  Actions by the user (such as mouse clicks or key presses)
  159. *  will result in programmer-specified routines being
  160. *  executed.  The ActnProc (action procedure) takes a GraphiC
  161. *  as its only argument, and is called when the user issues
  162. *  a command (such as clicking on a push button or making a
  163. *  selection from a menu).  Programs are written around these
  164. *  action callbacks.  The GraphiC parameter is the handle to
  165. *  the object that was acted upon by the user.  The ClckProc
  166. *  is used in PaneL objects to allow an instance-specific
  167. *  procedure that responds to click events.  The ScrlProc is
  168. *  used by scroll bars to return the slave, and the new and
  169. *  old scroll positions.
  170. *
  171. *  Because some compilers would allow actual callback functions
  172. *  to have the appropriate type (e.g., WindoW) if the following
  173. *  typedefs used Handle instead of GraphiC, whereas other
  174. *  compilers would flag these uses as errors, we define specific
  175. *  callback types for each class of object that uses ActnProc or
  176. *  ClckProc callbacks.
  177. */
  178.  
  179. typedef  void  (*Nlm_VoidProc) PROTO((void));
  180. typedef  void  (*Nlm_KeyProc)  PROTO((Nlm_Char));
  181. typedef  void  (*Nlm_ActnProc) PROTO((Nlm_GraphiC));
  182. typedef  void  (*Nlm_ClckProc) PROTO((Nlm_GraphiC, Nlm_PoinT));
  183. typedef  void  (*Nlm_CharProc) PROTO((Nlm_GraphiC, Nlm_Char));
  184. typedef  void  (*Nlm_ScrlProc) PROTO((Nlm_BaR, Nlm_GraphiC, Nlm_Int2, Nlm_Int2));
  185. typedef  void  (*Nlm_ChngProc) PROTO((Nlm_GraphiC, Nlm_Int2, Nlm_Int2));
  186. typedef  void  (*Nlm_FreeProc) PROTO((Nlm_GraphiC, Nlm_VoidPtr));
  187.  
  188. typedef  void  (*Nlm_BtnActnProc) PROTO((Nlm_ButtoN));
  189. typedef  void  (*Nlm_ChsActnProc) PROTO((Nlm_ChoicE));
  190. typedef  void  (*Nlm_GrpActnProc) PROTO((Nlm_GrouP));
  191. typedef  void  (*Nlm_IcnActnProc) PROTO((Nlm_IcoN));
  192. typedef  void  (*Nlm_ItmActnProc) PROTO((Nlm_IteM));
  193. typedef  void  (*Nlm_LstActnProc) PROTO((Nlm_LisT));
  194. typedef  void  (*Nlm_PnlActnProc) PROTO((Nlm_PaneL));
  195. typedef  void  (*Nlm_PupActnProc) PROTO((Nlm_PopuP));
  196. typedef  void  (*Nlm_RptActnProc) PROTO((Nlm_RepeaT));
  197. typedef  void  (*Nlm_TxtActnProc) PROTO((Nlm_TexT));
  198. typedef  void  (*Nlm_WndActnProc) PROTO((Nlm_WindoW));
  199. typedef  void  (*Nlm_WndFreeProc) PROTO((Nlm_WindoW, Nlm_VoidPtr));
  200.  
  201. typedef  void  (*Nlm_PnlClckProc) PROTO((Nlm_PaneL, Nlm_PoinT));
  202. typedef  void  (*Nlm_RptClckProc) PROTO((Nlm_RepeaT, Nlm_PoinT));
  203. typedef  void  (*Nlm_IcnClckProc) PROTO((Nlm_IcoN, Nlm_PoinT));
  204.  
  205. typedef  void  (*Nlm_BarScrlProc) PROTO((Nlm_BaR, Nlm_GraphiC, Nlm_Int2, Nlm_Int2));
  206. typedef  void  (*Nlm_SltScrlProc) PROTO((Nlm_BaR, Nlm_SlatE, Nlm_Int2, Nlm_Int2));
  207.  
  208. typedef  void  (*Nlm_IcnChngProc) PROTO((Nlm_IcoN, Nlm_Int2, Nlm_Int2));
  209. typedef  void  (*Nlm_SwtChngProc) PROTO((Nlm_SwitcH, Nlm_Int2, Nlm_Int2));
  210.  
  211. typedef  void  (*Nlm_SltCharProc) PROTO((Nlm_SlatE, Nlm_Char));
  212.  
  213. /***  CLASS FUNCTION TYPE DEFINITIONS  ***/
  214.  
  215. typedef  Nlm_Boolean  (*Nlm_BGph)             PROTO((Nlm_GraphiC));
  216. typedef  Nlm_Boolean  (*Nlm_BGphBol)          PROTO((Nlm_GraphiC, Nlm_Boolean));
  217. typedef  Nlm_Boolean  (*Nlm_BGphBolBol)       PROTO((Nlm_GraphiC, Nlm_Boolean, Nlm_Boolean));
  218. typedef  Nlm_Boolean  (*Nlm_BGphChr)          PROTO((Nlm_GraphiC, Nlm_Char));
  219. typedef  Nlm_Boolean  (*Nlm_BGphInt)          PROTO((Nlm_GraphiC, Nlm_Int2));
  220. typedef  Nlm_Boolean  (*Nlm_BGphPnt)          PROTO((Nlm_GraphiC, Nlm_PoinT));
  221. typedef  Nlm_GraphiC  (*Nlm_GGphChrBol)       PROTO((Nlm_GraphiC, Nlm_Char, Nlm_Boolean));
  222. typedef  Nlm_GraphiC  (*Nlm_GGphGph)          PROTO((Nlm_GraphiC, Nlm_GraphiC));
  223. typedef  Nlm_Int2     (*Nlm_IGph)             PROTO((Nlm_GraphiC));
  224. typedef  void         (*Nlm_VGph)             PROTO((Nlm_GraphiC));
  225. typedef  void         (*Nlm_VGphBol)          PROTO((Nlm_GraphiC, Nlm_Boolean));
  226. typedef  void         (*Nlm_VGphBolBol)       PROTO((Nlm_GraphiC, Nlm_Boolean, Nlm_Boolean));
  227. typedef  void         (*Nlm_VGphChrBol)       PROTO((Nlm_GraphiC, Nlm_Char, Nlm_Boolean));
  228. typedef  void         (*Nlm_VGphGphBol)       PROTO((Nlm_GraphiC, Nlm_GraphiC, Nlm_Boolean));
  229. typedef  void         (*Nlm_VGphIntBol)       PROTO((Nlm_GraphiC, Nlm_Int2, Nlm_Boolean));
  230. typedef  void         (*Nlm_VGphIntBolBol)    PROTO((Nlm_GraphiC, Nlm_Int2, Nlm_Boolean, Nlm_Boolean));
  231. typedef  void         (*Nlm_VGphIntChrBol)    PROTO((Nlm_GraphiC, Nlm_Int2, Nlm_CharPtr, Nlm_Boolean));
  232. typedef  void         (*Nlm_VGphIntChrSiz)    PROTO((Nlm_GraphiC, Nlm_Int2, Nlm_CharPtr, Nlm_sizeT));
  233. typedef  void         (*Nlm_VGphIntIntBol)    PROTO((Nlm_GraphiC, Nlm_Int2, Nlm_Int2, Nlm_Boolean));
  234. typedef  void         (*Nlm_VGphIntIntIntBol) PROTO((Nlm_GraphiC, Nlm_Int2, Nlm_Int2, Nlm_Int2, Nlm_Boolean));
  235. typedef  void         (*Nlm_VGphIptIpt)       PROTO((Nlm_GraphiC, Nlm_Int2Ptr, Nlm_Int2Ptr));
  236. typedef  void         (*Nlm_VGphRct)          PROTO((Nlm_GraphiC, Nlm_RectPtr));
  237. typedef  void         (*Nlm_VGphRctBol)       PROTO((Nlm_GraphiC, Nlm_RectPtr, Nlm_Boolean));
  238. typedef  void         (*Nlm_VGphRctBolBol)    PROTO((Nlm_GraphiC, Nlm_RectPtr, Nlm_Boolean, Nlm_Boolean));
  239.  
  240. /***  CLASS FUNCTION LIST STRUCTURE  ***/
  241.  
  242. /*
  243. *  Each instance of an object points to a class structure which contains
  244. *  internal procedures to call to handle the sorts of events or messages
  245. *  that an object may need to process.  New classes of objects can be
  246. *  created by gradually implementing more class-specific procedures.  The
  247. *  pointer to an ancestor class allows inheritance and overloading of
  248. *  class functions.  For ease of portability, it is expected that most if
  249. *  not all new classes of objects will be descendents of panel objects.
  250. *  Panels contain instance-specific procedure callbacks for click, drag,
  251. *  release, and draw, and constitute a windowing system-independent way
  252. *  of creating custom objects.
  253. */
  254.  
  255. typedef  struct  Nlm_gphprcs {
  256.  
  257.   struct Nlm_gphprcs PNTR ancestor;
  258.  
  259. #ifdef WIN_MAC
  260.   Nlm_BGphPnt           click;
  261.   Nlm_BGphChr           key;
  262.   Nlm_VGph              draw;
  263.   Nlm_BGphPnt           idle;
  264. #endif
  265.  
  266. #ifdef WIN_MSWIN
  267.   Nlm_BGph              command;
  268. #endif
  269.  
  270. #ifdef WIN_MOTIF
  271.   Nlm_VGph              callback;
  272. #endif
  273.  
  274.   Nlm_VGphBolBol        show;
  275.   Nlm_VGphBolBol        hide;
  276.   Nlm_VGphBolBol        enable;
  277.   Nlm_VGphBolBol        disable;
  278.  
  279.   Nlm_VGphBol           activate;
  280.   Nlm_VGphBol           deactivate;
  281.   Nlm_VGphBol           remove;
  282.   Nlm_VGphBol           reset;
  283.  
  284.   Nlm_VGphBol           select;
  285.   Nlm_IGph              countItems;
  286.   Nlm_GGphGph           linkIn;
  287.   Nlm_VGphRctBolBol     adjustPrnt;
  288.  
  289.   Nlm_VGphIntChrBol     setTitle;
  290.   Nlm_VGphIntChrSiz     getTitle;
  291.   Nlm_VGphIntBol        setValue;
  292.   Nlm_IGph              getValue;
  293.   Nlm_VGphIntBolBol     setStatus;
  294.   Nlm_BGphInt           getStatus;
  295.  
  296.   Nlm_VGphIntIntBol     setOffset;
  297.   Nlm_VGphIptIpt        getOffset;
  298.   Nlm_VGphRctBol        setPosition;
  299.   Nlm_VGphRct           getPosition;
  300.  
  301.   Nlm_VGphIntIntIntBol  setRange;
  302.   Nlm_GGphChrBol        gainFocus;
  303.   Nlm_VGphGphBol        loseFocus;
  304.   Nlm_VGphChrBol        sendChar;
  305.  
  306. } Nlm_GphPrcs, PNTR Nlm_GphPrcsPtr;
  307.  
  308. #ifdef __cplusplus
  309. }
  310. #endif
  311.  
  312. #endif
  313.